/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.ac.iie.di.ban.news.server.util.tracer;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

/**
 *
 * @author zwlin
 */
public interface DataTracer {

	public static enum ERR_TYPE {

		NO_ERROR(0),
		MD5_ERROR(1),
		JSON_ERROR(2),
		CHECK_ERROR(3);

		int n;

		private ERR_TYPE(int n) {
			this.n = n;
		}

		public int getType() {
			return n;
		}

	}

	public static final String ID_FIELD_NAME = "_id";
	public static final String SCOPE_FIELD_NAME = "scope";
	public static final String MSG_TYPE_FIELD_NAME = "msg_type";
	public static final String ERR_TYPE_FIELD_NAME = "err_type";
	public static final String CONTENT_FIELD_NAME = "content";
	public static final String GET_TIME_FIELD_NAME = "get_time";
	public static final String ERR_COUNT_FIELD_NAME = "err_count";
	public static final String TOTAL_COUNT_FIELD_NAME = "total_count";

	public void traceJsonParseError(String key, String content,
			long recvTimeSec) throws Exception;

	public void traceMD5Error(String key, String content,
			long recvTimeSec) throws Exception;

	public void traceCorrect(String key, JSONObject srcPac,
			JSON trackRecList, int totalCount, long recvTimeSec) throws Exception;

	public void traceJsonCheckError(String key, JSONObject srcPac,
			JSON trackRecList, int totalCount, int errorCount, long recvTimeSec) throws Exception;

	public String getTracerDetail();
}
